package com.niujie.prototypemanage.rest;


import com.niujie.prototypemanage.dto.ResultDTO;
import com.niujie.prototypemanage.mapper.UserMapper;
import com.niujie.prototypemanage.model.User;
import com.niujie.prototypemanage.pojo.LoginCodeEnum;
import com.niujie.prototypemanage.pojo.LoginProperties;
import com.niujie.prototypemanage.utils.CaptchaUtil;
import com.niujie.prototypemanage.utils.MailUtil;
import com.wf.captcha.base.Captcha;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.TimeUnit;


@RestController
@RequestMapping("user")
public class UserController {

    @Resource
    UserMapper userMapper;
    @Autowired
    MailUtil mailUtil;
    @Resource
    private CaptchaUtil captchaUtil;

    @GetMapping("/code")
    public ResultDTO getCode() {
        return ResultDTO.okOf(captchaUtil.getImg());
    }
}
